<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>讨论区</title>
<link rel="stylesheet" href="bootstrap-3.0.3/css/bootstrap.min.css">
<script src="js/jquery-2.1.1.min.js"></script>
<script src="bootstrap-3.0.3/js/bootstrap.min.js"></script>
<style type="text/css">
	td{
		height:35px;
	}
</style>
</head>
<body>
	<div style="width:1170px;margin:0px auto;height:155px;">
		<div><img alt="" src="css/images/logo.png"> </div>
		<nav class="navbar navbar-default" role="navigation">
			<div class="container-fluid">
				<div class="navbar-header" style="margin-left:20px;">
					<a class="navbar-brand" href="#">首页</a>
				</div>
			</div>
			<div class="container-fluid"> 
				<div class="navbar-header">
					<a class="navbar-brand" href="selectQuery">发表主题</a>
				</div>
				<form action="isbest" method="get" class="navbar-form navbar-left" role="search">
					<div class="form-group">
						<input type="text" name="title" value="${param.title}" class="form-control" placeholder="主题">
					</div>
					<button type="submit" class="btn btn-default">搜索</button>
				</form>
			</div>
			<div class="container-fluid" style="margin-right:20px;">
			   <c:if test="${loginUser!=null}">
					<ul class="nav navbar-nav navbar-right">
				      <li><a href="#"><span class="glyphicon glyphicon-user"></span>${loginUser.userName} </a></li>
				      <li><a href="cancel"><span class="glyphicon glyphicon-log-in"></span>注销</a></li>
				    </ul> 
				</c:if>
				<c:if test="${loginUser==null}">
				    <ul class="nav navbar-nav navbar-right">
				      <li><a href="user_register.jsp"><span class="glyphicon glyphicon-user"></span> 注册</a></li>
				      <li><a href="user_login.jsp"><span class="glyphicon glyphicon-log-in"></span> 登录</a></li>
				    </ul>
			    </c:if>
			 </div>
		</nav>
	</div>
	<div style="width:1170px;height:30px;margin:0px auto;background-color: #F5F5F5;text-indent:1.5em;color: #0C91E0;line-height: 32px;border:2px solid #EFEFEF;">
		首页 / Android讨论区
	</div>
	<div style="width:1170px;height:270px;margin:0px auto;margin-top: 20px;border:2px solid #EFEFEF;border-radius:5px;">
		<p style="background-color:#F5F5F5; border-radius:5px 5px 0 0;line-height: 35px;text-indent:1.5em;">Android讨论区-精华区</p>
		<table class="table table-condensed" style="width:1170px;text-align: center;">
			<thead>
				<tr>
					<th style="text-align: center;">主题</th>
					<th style="text-align: center;">作者</th>
					<th style="text-align: center;">回复</th>
					<th style="text-align: center;">最后更新时间</th>
				</tr>
			</thead>
			<tbody>
				<c:forEach items="${topics }" var="topic">
				<tr>
					<td><a href="getById?topicId=${topic.id}&userId=${topic.user.id}">${topic.title }</a></td>
					<td>${topic.user.userName }</td>
					<td>${topic.commentTimes }</td>
					<td>${topic.updateTime }</td>
				</tr>
				</c:forEach>
			</tbody>
		</table>
	</div>
	<div style="width:1170px;height:350px;margin:0px auto;margin-top: 20px;margin-bottom:20px;border:2px solid #EFEFEF;border-radius:5px;">
		<p style="background-color:#F5F5F5; border-radius:5px 5px 0 0;line-height: 35px;text-indent:1.5em;">Android讨论区-讨论区</p>
		<table class="table table-condensed" style="width:1170px;text-align: center;">
			<thead>
				<tr>
					<th style="text-align: center;">主题</th>
					<th style="text-align: center;">作者</th>
					<th style="text-align: center;">回复</th>
					<th style="text-align: center;">最后更新时间</th>
				</tr>
			</thead>
			<tbody>
				<c:forEach items="${newTopics }" var="newTop">
				<tr>
					<td><a href="getById?topicId=${topic.id}">${newTop.title }</a></td>
					<td>${newTop.user.userName }</td>
					<td>${newTop.commentTimes }</td>
					<td>${newTop.updateTime }</td>
				</tr>
				</c:forEach>
				<tr>
					<td colspan="4">
						<ul class="pagination" style="margin-left: -10px;">
						    <li><a href="isbest?forumId=${param.forumId}&pageNo=${pageNo-1 }">&laquo;</a></li>
						    <li class="active"><a href="isbest?forumId=${param.forumId}&pageNo=1">1</a></li>
						    <li class="disabled"><a href="isbest?forumId=${param.forumId}&pageNo=2">2</a></li>
						    <li><a href="isbest?forumId=${param.forumId}&pageNo=3">3</a></li>
						    <li><a href="isbest?forumId=${param.forumId}&pageNo=4">4</a></li>
						    <li><a href="isbest?forumId=${param.forumId}&pageNo=5">5</a></li>
						    <li><a href="isbest?forumId=${param.forumId}&pageNo=${pageNo+1}">&raquo;</a></li>
						    <li><a href="#">共页，第页</a></li>
						</ul>
					</td>
				</tr>
			</tbody>
		</table>
	</div>
	<div id="footer" style="margin-top:20px;width:1170px;height:70px; margin:0px auto;background-color: #F5F5F5;text-align: center;border:1px solid #EBEBEB;">
		<p>手机论坛 xda.cn</p>
		<p>Designed Sam Chen</p>
	</div>
</body>
</html>